STEP 4: Your program makes a new random number between 1 and 6 every time it runs! Let's display it!

  • Go to and drag out Variable Display. Drop it at the bottom of your program.
  • Find the variable parameter (my_var) in .Display(). Change it to roll_1.

We've also added the dice sprite to your code that shows the number you randomly generated. You can leave this line as it is.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)